﻿using NUnit.Framework;
using Smartkernel;
using Smartkernel.Extensions;

namespace Smartkernel.NUnitTest.Extensions
{
    [Category("Extensions")]
    [TestFixture]
    public class SmartDoubleExtensionTest
    {
        [Test]
        public void Test()
        {
            //【01】输出不同格式化形式（涉及方法：ToString）
            double i = 988219.74123d;
            Assert.AreEqual(i.ToString(SmartNumberFormatType.C), "￥988,219.74");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.E), "9.882197E+005");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.G), "988219.74123");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.P), "98,821,974.12%");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.ChineseCurrency), "玖拾捌万捌仟贰佰壹拾玖元柒角肆分");
        }
    }
}
